﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;

namespace AIRO.Devices.PositioningDevice
{

    [Guid("A555C8FC-F636-42a8-8BDB-440D398003F9")]
    public enum PositioningDeviceState
    {
        Running,
        Idle,
        Error
    }


    [Guid("728F9A94-CFDE-488d-BE3A-7B1BF23CC77C")]
    [ClassInterface(ClassInterfaceType.None)]
    [ProgId("AIRO.Devices.PositioningDevice.StateChangedEventArgs")]
    public class StateChangedEventArgs : EventArgs
    {

        private PositioningDeviceState _newState;

        public StateChangedEventArgs(PositioningDeviceState newState)
        {
            this._newState = newState;
        }

        public PositioningDeviceState State
        {
            get
            {
                return _newState;
            }
        }
    }

    [Guid("ABE4417A-3CBC-4416-9E0E-50369CE7D722")]
    [ClassInterface(ClassInterfaceType.None)]
    [ProgId("AIRO.Devices.PositioningDevice.FinishEventArgs")]
    public class FinishEventArgs : EventArgs
    {
        private double _position;
        public FinishEventArgs(double position)
        {
            this._position = position;
        }
        public double Position
        {
            get
            {
                return _position;
            }
        }

    }


    [Guid("7F679431-9099-4864-8A94-0D4A5A2CF312")]
    [ClassInterface(ClassInterfaceType.None)]
    [ProgId("AIRO.Devices.PositioningDevice.ProgressEventArgs")]
    public class ProgressEventArgs : EventArgs
    {
        private double _position;
        public ProgressEventArgs(double position)
        {
            this._position = position;
        }
        public double Position
        {
            get
            {
                return _position;
            }
        }
    }

    [Guid("693FAF63-05A6-42fa-945D-236F8BFB40CB")]
    [InterfaceType(ComInterfaceType.InterfaceIsDual)]
    public interface IPositioningDevice
    {
        [DispId(1)]
        PositioningDeviceState State { get; }
        [DispId(2)]
        double Position { get; }
        [DispId(3)]
        void BeginMove(double position);
        [DispId(4)]
        void Move(double position);
        [DispId(5)]
        event EventHandler<StateChangedEventArgs> StateChangedEvent;
        [DispId(6)]
        event EventHandler<FinishEventArgs> FinishEvent;
        [DispId(7)]
        event EventHandler<ProgressEventArgs> ProgressEvent;
    }
}

